package createHookCode;

public abstract class Employee extends Human{

	public static Employee createEmployee(int type, int comission, int bonus) {
		switch (type) {
		case ENGINEER:
			return new Engineer(comission, bonus);
		case SALESMAN:
			return new Salesman(comission, bonus);
		case MANAGER:
			return new Manager(comission, bonus);
		default:
			throw new IllegalArgumentException("Illegal Employee");
		}
	}

	public static Employee createEmployee(int type) {
		return createEmployee(type, 0, 0);
	}


	protected int _monthlySalary;
	protected int _commission;
	protected int _bonus;
	public static final int ENGINEER = 0;
	public static final int SALESMAN = 1;
	public static final int MANAGER = 2;

	public Employee (int comission, int bonus) throws IllegalArgumentException{
		super("NONE");
		_commission = comission;
		_bonus = bonus;
	}
	
	public Employee () {
		this(0, 0);
	}

	public int payAmount() throws RuntimeException {
		switch (get_type()) {
            case Employee.ENGINEER:
               return _monthlySalary;
            case Employee.SALESMAN:
               return _monthlySalary + _commission;
            case Employee.MANAGER:
               return _monthlySalary + _bonus;
            default:
               throw new RuntimeException("Incorrect Employee");
        }
	}
	
	public abstract String printFlyer();
	
	public abstract int get_type();
}
